package org.ssgroup.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import sun.security.jca.GetInstance;

/**
 * 2017-06-08
 * @author yuruixin
 */
public class JdbcUtils {
	private static final String URL = "jdbc:mysql://127.0.0.1:3306/jysystem";
	private static final String UNAME = "root";
	private static final String PWD = "root";

	private static Connection conn = null;
	
	static {
		try {
			Class.forName("com.mysql.jdbc.Driver");// 1.加载驱动程序
			conn = DriverManager.getConnection(URL, UNAME, PWD);	// 2.获得数据库的连接
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	
	public static Connection getConnection() {
		return conn;
	}
}